<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/white/common/common.jsp"%>
<%@include file="/white/common/taglibs.jsp"%>
<html>
	<head>
		<script type="text/javascript">
        
        function validateAdd() {
        	var url = ""

			url = "prodCustomerAction!toAdd.action";

			openWindow(url, 850, 500);
        }
        
        function submitForm(){
            var searchForm=document.getElementById("searchForm");
            searchForm.submit();
        }
        
        function notAllowedLockSelf(id){           
            var searchForm=document.getElementById("searchForm");
            searchForm.action="userAction-"+id+"!lock.action";
            searchForm.submit();            
        }
        
        function validateModify(){        	
        	var check = document.getElementsByName("selectedIds");
        	var a = 0;
            var id;
           
            for(var i=0;i <check.length;i++){
                if(check[i].checked==true){
                    a++;
                    id = check[i].value;
                }
            }
            
            if(a == 1){            	
            	var url = "" 
            	         	
            	var searchForm=document.getElementById("searchForm");
            	
            	url = "prodCustomerAction-"+id+"!toEdit.action";
            	
            	openWindow(url,850,500);
            }else{
                alert("请先选择一条记录!!");
            }
        }  
        
        function anyUpdate(){   
        	var check=document.getElementsByName("selectedIds");
            var a=false;
            for(var i=0;i <check.length;i++){
                if(check[i].checked==true){
                    a=true;
                    break;
                }
            }
            if(a){
            	 var searchForm=document.getElementById("searchForm");
                 searchForm.action='prodCustomerAction!anyUpdate.action';
                 searchForm.target="_blank";
                 searchForm.submit();
            }else{
                alert("请先择你要修改的内容!!");
                
            }
        	
        	
        }        
        
        
        function validateDelete(){
            var check=document.getElementsByName("selectedIds");
            var a=false;
            for(var i=0;i <check.length;i++){
                if(check[i].checked==true){
                    a=true;
                    break;
                }
            }
            if(a){
                return confirm('你确定删除所选内容??');
            }else{
                alert("请先择你要删除的内容!!");
                return false;
            }
        }

        function doDelete(){
            var searchForm=document.getElementById("searchForm");
            searchForm.action='prodCustomerAction!delete.action';
            searchForm.submit();
            return true;
        }
        
        function validatedown(){
            var check=document.getElementsByName("selectedIds");
            var a=false;
            for(var i=0;i <check.length;i++){
                if(check[i].checked==true){
                    a=true;
                    break;
                }
            }
            if(a){
                return confirm('你确定下线所选内容??');
            }else{
                alert("请先择你要下线的内容!!");
                return false;
            }
        }

        function dodown(){
            var searchForm=document.getElementById("searchForm");
            searchForm.action='prodCustomerAction!down.action';
            searchForm.submit();
            return true;
        }
        
        function displayResult(){
            var result = "<s:property value='result'/>";
            if(result != null && result != ""){
                alert(result);
            }
        }    
        
         function tosearch(){
            var searchForm=document.getElementById("searchForm");
            searchForm.target="";
            searchForm.action='prodCustomerAction!queryBDCByPage.action';
            searchForm.submit();
            }
       function excel(){
            var searchForm=document.getElementById("searchForm");
            searchForm.action='prodCustomerAction!exportExcel.action';
            searchForm.submit();
            } 
       
       function workLoad(){
    	   url = "prodCustomerAction!queryWorkload.action";

			openWindow(url, 850, 500);       }
    //-->
    
    
    function createXHR() {
    if (window.XMLHttpRequest) {
        return new XMLHttpRequest();
    }
    if (window.ActiveXObject) {
        var msxmls = ['MSXML3', 'MSXML2', 'Microsoft']
        for (var i=0; i < msxmls.length; i++) {
            try {
                return new ActiveXObject(msxmls[i]+'.XMLHTTP')
            } catch (e) { }
        }
        throw new Error("No XML component installed!")
    }
} 
    function showCount()
{
var xmlhttp = createXHR();

if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("txtHint").innerHTML="总共"+xmlhttp.responseText+"条";
    }
  }
xmlhttp.open("GET","prodCustomerAction!count.action",true);
                                 
xmlhttp.send();
}
    </script>
	</head>
	<body onload="displayResult()">
		<s:form method="post" action="prodCustomerAction!queryBDCByPage.action"
			theme="simple" id="searchForm">
			<div id="div_title">
				<h3>
					产品客户管理
				</h3>
				<div id="div_search">
					<table>
						<tr>
							<!-- 查询条件 -->
							<td width="80" align="right">
								一级分类编号:
							</td>
							<td>
								<s:textfield name="query_prodClassCode1" />
							</td>
							<td width="80" align="right">
								一级分类名称:
							</td>
							<td>
								<s:textfield name="query_prodClassName1" />
							</td>
							<td width="80" align="right">
								二级分类编号:
							</td>
							<td>
								<s:textfield name="query_prodClassCode2" />
							</td>
							<td width="80" align="right">
								二级分类名称:
							</td>
							<td>
								<s:textfield name="query_prodClassName2" />
							</td>
						</tr>
						<tr>
							<td width="80" align="right">
								客户编号:
							</td>
							<td>
								<s:textfield name="query_custId" />
							</td>
							<td width="80" align="right">
								品牌编号:
							</td>
							<td>
								<s:textfield name="query_groupId" />
							</td>
							<td width="80" align="right">
								客户名称1:
							</td>
							<td>
								<s:textfield name="query_name1" />
							</td>
							<td width="80" align="right">
								客户名称2:
							</td>
							<td>
								<s:textfield name="query_name2" />
							</td>
						</tr>
						<tr>
							<td width="80" align="right">
								区号:
							</td>
							<td>
								<s:textfield name="query_areaCode" />
							</td>
							<td width="80" align="right">
								电话:
							</td>
							<td>
								<s:textfield name="query_tel" />
							</td>
							<td width="80" align="right">
								地区代码:
							</td>
							<td>
								<s:textfield name="query_regionCode" />
							</td>
							<td width="80" align="right">
								城市名称:
							</td>
							<td>
								<s:textfield name="query_cityName" />
							</td>
						</tr>
						<tr>	
							<td width="80" align="right">
								地址:
							</td>
							<td>
								<s:textfield name="query_addr" />
							</td>						
							<td width="80" align="right">
								来源:
							</td>
							<td>
								<s:textfield name="query_source" />
							</td>
							<td width="80" align="right">
								存档电话：
							</td>
							<td>
							<s:textfield name="query_oldTel" />
								
							</td>
							<td width="80" align="right">
							
							</td>
							<td>
														</td>
						</tr>
						
						
						<!--  
						<tr>
							<td width="80" align="right">
								DestrictCode:
							</td>
							<td>
								<s:textfield name="query_destrictCode" />
							</td>
							<td width="80" align="right">
								DestrictName:
							</td>
							<td>
								<s:textfield name="query_destrictName" />
							</td>
						</tr>
						<tr>
							<td width="80" align="right">
								Zip:
							</td>
							<td>
								<s:textfield name="query_zip" />
							</td>
							<td width="80" align="right">
								PyAddr:
							</td>
							<td>
								<s:textfield name="query_pyAddr" />
							</td>
							<td width="80" align="right">
								EngAddr:
							</td>
							<td>
								<s:textfield name="query_engAddr" />
							</td>
						</tr>
						<tr>
							<td width="80" align="right">
								Poix:
							</td>
							<td>
								<s:textfield name="query_poix" />
							</td>
							<td width="80" align="right">
								Poiy:
							</td>
							<td>
								<s:textfield name="query_poiy" />
							</td>
							<td width="80" align="right">
								CustStatus:
							</td>
							<td>
								<s:textfield name="query_custStatus" />
							</td>
							<td width="80" align="right">
								CustTypeCode:
							</td>
							<td>
								<s:textfield name="query_custTypeCode" />
							</td>
						</tr>
						<tr>
							<td width="80" align="right">
								ClassMainId:
							</td>
							<td>
								<s:textfield name="query_classMainId" />
							</td>
							<td width="80" align="right">
								OrgId:
							</td>
							<td>
								<s:textfield name="query_orgId" />
							</td>
							<td width="80" align="right">
								Url:
							</td>
							<td>
								<s:textfield name="query_url" />
							</td>
							<td width="80" align="right">
								Weibo:
							</td>
							<td>
								<s:textfield name="query_weibo" />
							</td>
						</tr>
						<tr>
							<td width="80" align="right">
								Weixin:
							</td>
							<td>
								<s:textfield name="query_weixin" />
							</td>
							<td width="80" align="right">
								Yixin:
							</td>
							<td>
								<s:textfield name="query_yixin" />
							</td>
							<td width="80" align="right">
								Logo:
							</td>
							<td>
								<s:textfield name="query_logo" />
							</td>
							<td width="80" align="right">
								SafeStatus:
							</td>
							<td>
								<s:textfield name="query_safeStatus" />
							</td>
						</tr>
						<tr>
							<td width="80" align="right">
								BxName:
							</td>
							<td>
								<s:textfield name="query_bxName" />
							</td>
							<td width="80" align="right">
								PyName:
							</td>
							<td>
								<s:textfield name="query_pyName" />
							</td>
							<td width="80" align="right">
								EngName:
							</td>
							<td>
								<s:textfield name="query_engName" />
							</td>
							<td width="80" align="right">
								SpName:
							</td>
							<td>
								<s:textfield name="query_spName" />
							</td>
						</tr>
						<tr>
							<td width="80" align="right">
								SourceId:
							</td>
							<td>
								<s:textfield name="query_sourceId" />
							</td>
							<td width="80" align="right">
								ProdClassId:
							</td>
							<td>
								<s:textfield name="query_prodClassId" />
							</td>
							<td width="80" align="right">
								ModifyTime:
							</td>
							<td width="80" align="right">
								<s:textfield name="query_modifyTime" label="日期"
									onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd', minDate:'1900-01-01',maxDate:''})"></s:textfield>
							</td>
							<td width="80" align="right">
								ModifyEmpId:
							</td>
							<td>
								<s:textfield name="query_modifyEmpId" />
							</td>
						</tr>
						<tr>
							<td width="80" align="right">
								InputTime:
							</td>
							<td width="80" align="right">
								<s:textfield name="query_inputTime" label="日期"
									onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd', minDate:'1900-01-01',maxDate:''})"></s:textfield>
							</td>
							<td width="80" align="right">
								InputEmpId:
							</td>
							<td>
								<s:textfield name="query_inputEmpId" />
							</td>
							<td width="80" align="right">
								Id:
							</td>
							<td>
								<s:textfield name="query_id" />
							</td>
						</tr>
						<tr>
							<td width="80" align="right">
								Subname1:
							</td>
							<td>
								<s:textfield name="query_subname1" />
							</td>
							<td width="80" align="right">
								Subname2:
							</td>
							<td>
								<s:textfield name="query_subname2" />
							</td>
							<td width="80" align="right">
								Subname3:
							</td>
							<td>
								<s:textfield name="query_subname3" />
							</td>
							<td width="80" align="right">
								Subname4:
							</td>
							<td>
								<s:textfield name="query_subname4" />
							</td>
						</tr>
						<tr>
							<td width="80" align="right">
								TelExt:
							</td>
							<td>
								<s:textfield name="query_telExt" />
							</td>
							<td width="80" align="right">
								FaxFlag:
							</td>
							<td>
								<s:textfield name="query_faxFlag" />
							</td>
							<td width="80" align="right">
								Sb:
							</td>
							<td>
								<s:textfield name="query_sb" />
							</td>
							<td width="80" align="right">
								ListOrder:
							</td>
							<td>
								<s:textfield name="query_listOrder" />
							</td>
							<td width="80" align="right">
								RegionName:
							</td>
							<td>
								<s:textfield name="query_regionName" />
							</td>
							<td width="80" align="right">
								CityCode:
							</td>
							<td>
								<s:textfield name="query_cityCode" />
							</td>
						</tr>
						-->
						
						<tr>
							<td width="80" align="right">
								<authz:authorize ifAnyGranted="OMC_PROD_CUSTOMER">
<%-- 									<s:submit cssClass="submit_search" value="搜索"
										action="prodCustomerAction!queryByPage" /> --%>
										<input type="button" class="submit_search"  value="搜索" onClick="tosearch();">
								</authz:authorize></td>
						
					</tr>
					</table>					
				</div>
			</div>
			<div id="div_button" style="display:none;">
				<authz:authorize ifAnyGranted="OMC_PROD_CUSTOMER">
					<input type="button" value="新增"
						onclick="validateAdd();return false;"
						cssClass="input_button" />
				</authz:authorize>
				<authz:authorize ifAnyGranted="OMC_PROD_CUSTOMER">
					<input type="button" value="修改" onclick="validateModify()"
						cssClass="input_button" />	
						
						<input type="button" value="批量修改" onclick="anyUpdate()"
						cssClass="input_button" />
						
					<input type="button" cssClass="input_button" value="导出" onClick="excel();document.getElementById('searchForm').action='prodCustomerAction!queryByPage.action';"/>
				</authz:authorize>
				 
				<authz:authorize ifAnyGranted="OMC_PROD_CUSTOMER">
					<input type="button" value="删除"
						onclick="if(validateDelete()){doDelete()}" >
				</authz:authorize>
				<authz:authorize ifAnyGranted="OMC_PROD_CUSTOMER">
					<input type="button" value="360下线" size=“15”
						onclick="if(validatedown()){dodown()}" >
				</authz:authorize>
				<input type="button" value="工作量统计" size=“15”
						onclick="workLoad()" >		 
				<%@include file="/white/common/message.jsp"%>
			</div>
			<!--列表 开始 -->
			<table cellpadding="0" cellspacing="0" class="t_list">
				<tr>
					<!--列表头部 -->
					<th>
						一级分类编号
					</th>
					<th>
						一级分类名称
					</th>
					<th>
						二级分类编号
					</th>
					<th>
						二级分类名称
					</th>
					<th>
						客户编号
					</th>
					<th>
						品牌编号
					</th>
					<th>
						客户名称1
					</th>
					<th>
						客户名称2
					</th>
					<th>
						区号
					</th>
					<th>
						电话
					</th>
					<th>
						分机
					</th>
					<th>
						列名次序
					</th>
					<th>
						地区代码
					</th>
					<th>
						地区名称
					</th>
					<th>
						城市代码
					</th>
					<th>
						城市名称
					</th>
					<th>
						地址
					</th>
					<th>
						邮编
					</th>
					<th>
						客户状态
					</th>
					<th>
						Url
					</th>
					<th>
						微博
					</th>
					<th>
						微信
					</th>
					<th>
						易信
					</th>
					<th>
						来源
					</th>
					<th>
						存档电话
					</th>
					
					<!-- 
					<th>
						ModifyEmpId
					</th>
					<th>
						InputEmpId
					</th>
					<th>
						SourceId
					</th>
					<th>
						CustTypeCode
					</th>
					<th>
						ProdClassId
					</th>
					<th>
						Id
					</th>
					<th>
						Logo
					</th>
					<th>
						SafeStatus
					</th>
					<th>
						BxName
					</th>
					<th>
						PyName
					</th>
					<th>
						EngName
					</th>
					<th>
						SpName
					</th>
					<th>
						ClassMainId
					</th>
					<th>
						OrgId
					</th>
					<th>
						Subname1
					</th>
					<th>
						Subname2
					</th>
					<th>
						Subname3
					</th>
					<th>
						Subname4
					</th>
					<th>
						FaxFlag
					</th>
					<th>
						Sb
					</th>
					<th>
						DestrictCode
					</th>
					<th>
						DestrictName
					</th>
					<th>
						AreaCode
					</th>
					<th>
						PyAddr
					</th>
					<th>
						EngAddr
					</th>
					<th>
						Poix
					</th>
					<th>
						Poiy
					</th>
					-->
				</tr>
				<s:iterator value="resultList" status="sindex">
					<tr>
						<td>
							<s:property value="PROD_CLASS_CODE1" />
						</td>
						<td>
							<s:property value="PROD_CLASS_NAME1" />
						</td>
						<td>
							<s:property value="PROD_CLASS_CODE2" />
						</td>
						<td>
							<s:property value="PROD_CLASS_NAME2" />
						</td>
						<td>
							<s:property value="CUST_ID" />
						</td>
						<td>
							<s:property value="GROUP_ID" />
						</td>
						<td>
							<s:property value="NAME1" />
						</td>
						<td>
							<s:property value="NAME2" />
						</td>
						<td>
							<s:property value="AREA_CODE" />
						</td>
						<td>
							<s:property value="TEL" />
						</td>
						<td>
							<s:property value="TEL_EXT" />
						</td>
						<td>
							<s:property value="LIST_ORDER" />
						</td>
						<td>
							<s:property value="REGION_CODE" />
						</td>
						<td>
							<s:property value="REGION_NAME" />
						</td>
						<td>
							<s:property value="CITY_CODE" />
						</td>
						<td>
							<s:property value="CITY_NAME" />
						</td>
						<td>
							<s:property value="ADDR" />
						</td>
						<td>
							<s:property value="ZIP" />
						</td>
						<td>
							<s:property value="CUST_STATUS" />
						</td>
						<td>
							<s:property value="URL" />
						</td>
						<td>
							<s:property value="WEIBO" />
						</td>
						<td>
							<s:property value="WEIXIN" />
						</td>
						<td>
							<s:property value="YIXIN" />
						</td>
						<td>
							<s:property value="SOURCE" />
						</td>
						<td>
							<s:property value="OLD_TEL" />
						</td>
						<!--  
						<td>
							<s:property value="SAFE_STATUS" />
						</td>
						<td>
							<s:property value="FAX_FLAG" />
						</td>
						<td>
							<s:property value="LOGO" />
						</td>
						<td>
							<s:property value="SB" />
						</td>
						<td>
							<s:property value="BX_NAME" />
						</td>
						<td>
							<s:property value="PY_NAME" />
						</td>
						<td>
							<s:property value="ENG_NAME" />
						</td>
						<td>
							<s:property value="SP_NAME" />
						</td>
						<td>
							<s:property value="DESTRICT_CODE" />
						</td>
						<td>
							<s:property value="DESTRICT_NAME" />
						</td>
						<td>
							<s:property value="AREA_CODE" />
						</td>
						<td>
							<s:property value="SOURCE_ID" />
						</td>
						<td>
							<s:property value="PROD_CLASS_ID" />
						</td>
						<td>
							<s:property value="ID" />
						</td>
						
						<td>
							<s:property value="SUBNAME2" />
						</td>
						<td>
							<s:property value="CUST_TYPE_CODE" />
						</td>
						<td>
							<s:property value="CLASS_MAIN_ID" />
						</td>
						<td>
							<s:property value="ORG_ID" />
						</td>
						<td>
							<s:property value="SUBNAME3" />
						</td>
						<td>
							<s:property value="SUBNAME4" />
						</td>
						<td>
							<s:property value="PY_ADDR" />
						</td>
						<td>
							<s:property value="ENG_ADDR" />
						</td>
						<td>
							<s:property value="POIX" />
						</td>
						<td>
							<s:property value="POIY" />
						</td>
						-->
					</tr>
				</s:iterator>
			</table>
			<!--列表 结束 -->
			<!--分页 开始 -->
			<s:if test="resultList.size() > 0">
				<table border="0" cellspacing="0" cellpadding="0" class="t_bottom">
					<tr>
						<td><%@include file="/white/common/pageList.jsp"%></td>
					</tr>
				</table>
			</s:if>
			<!--分页 结束 -->

		</s:form>
	</body>
</html>
